At first you have to set a seed (int number) which is characteristic for the random number sequence (the seed is set to 1802 by default).
( 1)>set_seed(1234);For example to get 100 standard normal distributed random numbers or uniformal distributed random numbers between zero and one, use the commands:
( 2)>xn=randomn(100); ( 3)>xu=randomu(100);A sequence of random numbers can be repeated by saving the generators status in a double array with 1634 entries:
( 4)>g=get_seed() ( 5)>os=ostream("status.data",\bin); ( 6)>os << g; ( 7)>delete os; ( 8)>print(randomn()); <dblarr> 1.416605 ( 9)>quitTo recover the generator for the next session type
( 1)>is=istream("status.data",\bin); ( 2)>double g[1634]; ( 3)>is >>g; ( 4)>delete is; ( 5)>recover_seed(g); ( 6)>print(randomn()); <dblarr> 1.416605
The result of
( 7)>print(erf(dincarr(3)-1)); <dblarr> -0.84270079 0 0.84270079corresponds to the normalized Gauss function for -1, 0 and 1. The cumulativ Gauss function can be evaluated by the function erfc. The gamma function for the numbers 1,2,3 and 4 can be computed with the function
( 8)>print(gamma(dincarr(4)+1)); <dblarr> 1 1 2 6Supported standard bessel functions are besseli0, besseli1, besselj0, besselj1, bessely0, bessely1. (hopefully the names are self explaining;-)